#pragma once
#include <string>
#include<iostream>

class Task
{
public:
    Task() = default;

    Task(int x, int y, char op)
        :_x(x)
        ,_y(y)
        ,_op(op)
    {}

    void operator()()
    {
        switch(_op)
        {
            case '+':
                _result = _x + _y;
                break;
            case '-':
                _result = _x - _y;
                break;
            case '*':
                _result = _x * _y;
                break;
            case '/':
                if(_y == 0)
                {
                    _status = -1;
                    break;
                }
                _result = _x / _y;
                break;
            default:
                break;
        }
    }

    void print()
    {
        std::cout << _x << " " << _op << " " << _y << " = " << _result << "["<<_status<<"]"<<std::endl;
    }

    ~Task() {}

private:
    int _x;
    int _y;
    char _op;

    int _result;
    int _status = 0;
};